#include<stdio.h>

int main(int arc, char *argv[])
{

	if(argv[1] == NULL)
	{
		fprintf(stderr, "I need one argument, the size of the matrices!\n");
		return 1;
	}

	FILE *file = fopen("in.data", "w");

	int size = atoi(argv[1]);
	fprintf(file, "%d\n", size);

	int i, j;
	
	for(i = 0; i < size; i++)
	{
		for(j = 0; j < size; j++)
		{
			if (size >= 1920) //avoid overflow in 1920 X 1920 matrix
				fprintf( file, "%d ", rand() % 2);
			else
				fprintf(file, "%d ", rand() %5);
		}
		fprintf(file, "\n");
	}

	fprintf(file, "\n");

	for(i = 0; i < size; i++)
        {
                for(j = 0; j < size; j++)
                {
                        if (size >= 1920) //avoid overflow in 1920 X 1920 matrix
                                fprintf( file, "%d ", rand() % 2);
                        else
                                fprintf(file, "%d ", rand() %5);
                }
                fprintf(file, "\n");
        }


	fclose(file);
}
